import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home/index.vue'),
    },
    {
      path: '/game',
      name: 'game',
      component: () => import('@/views/game/index.vue'),
      children: [
        {
          path: 'jndeb',
          name: 'jndeb',
          component: () => import('@/views/game/jndeb/index.vue'),
          redirect: '/game/jndeb/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/jndeb/bet.vue'),
              name: 'jndebBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/jndeb/road.vue'),
              name: 'jndebRoad',
            },
            {
              path: 'record',
              name: 'jndebRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'JNDEB' },
            },
          ],
        },
        {
          path: 'xglhc',
          name: 'xglhc',
          component: () => import('@/views/game/xglhc/index.vue'),
          redirect: '/game/xglhc/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/xglhc/bet.vue'),
              name: 'xglhcBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/xglhc/road.vue'),
              name: 'xglhcRoad',
            },
            {
              path: 'record',
              name: 'xglhcRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'XGLHC' },
            },
          ],
        },
        {
          path: 'jndlhc',
          name: 'jndlhc',
          component: () => import('@/views/game/tpl-lhc/index.vue'),
          redirect: '/game/jndlhc/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/tpl-lhc/bet.vue'),
              name: 'jndlhcBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/tpl-lhc/road.vue'),
              name: 'jndlhcRoad',
            },
            {
              path: 'record',
              name: 'jndlhcRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'JNDLHC' },
            },
          ],
        },
        {
          path: 'qxc',
          name: 'qxc',
          component: () => import('@/views/game/qxc/index.vue'),
          redirect: '/game/qxc/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/qxc/bet.vue'),
              name: 'qxcBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/qxc/road.vue'),
              name: 'qxcRoad',
            },
            {
              path: 'record',
              name: 'qxcRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'QXC' },
            },
          ],
        },
        {
          path: 'pcnn',
          name: 'pcnn',
          component: () => import('@/views/game/pcnn/index.vue'),
          redirect: '/game/pcnn/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/pcnn/bet.vue'),
              name: 'pcnnBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/pcnn/road.vue'),
              name: 'pcnnRoad',
            },
            {
              path: 'record',
              name: 'pcnnRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'PCNN' },
            },
          ],
        },
        {
          path: 'pcbjl',
          name: 'pcbjl',
          component: () => import('@/views/game/pcbjl/index.vue'),
          redirect: '/game/pcbjl/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/pcbjl/bet.vue'),
              name: 'pcbjlBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/pcbjl/road.vue'),
              name: 'pcbjlRoad',
            },
            {
              path: 'record',
              name: 'pcbjlRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'PCBJL' },
            },
          ],
        },
        {
          path: 'jndsi',
          name: 'jndsi',
          component: () => import('@/views/game/jndsi/index.vue'),
          redirect: '/game/jndsi/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/jndsi/bet.vue'),
              name: 'jndsiBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/jndsi/road.vue'),
              name: 'jndsiRoad',
            },
            {
              path: 'record',
              name: 'jndsiRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'JNDSI' },
            },
          ],
        },
        {
          path: 'jndwu',
          name: 'jndwu',
          component: () => import('@/views/game/jndwu/index.vue'),
          redirect: '/game/jndwu/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/jndwu/bet.vue'),
              name: 'jndwuBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/jndwu/road.vue'),
              name: 'jndwuRoad',
            },
            {
              path: 'record',
              name: 'jndwuRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'JNDWU' },
            },
          ],
        },
        {
          path: 'jndwp',
          name: 'Jndwp',
          component: () => import('@/views/game/jndwp/index.vue'),
          redirect: '/game/jndwp/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/jndwp/bet.vue'),
              name: 'jndwpBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/jndwp/road.vue'),
              name: 'jndwpRoad',
            },
            {
              path: 'record',
              name: 'jndwpRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'JNDWP' },
            },
          ],
        },
        {
          path: 'jndssc',
          name: 'jndssc',
          component: () => import('@/views/game/jndssc/index.vue'),
          redirect: '/game/jndssc/bet',
          children: [
            {
              path: 'bet',
              component: () => import('@/views/game/jndssc/bet.vue'),
              name: 'jndsscBet',
            },
            {
              path: 'road',
              component: () => import('@/views/game/jndssc/road.vue'),
              name: 'jndsscRoad',
            },
            {
              path: 'record',
              name: 'jndsscRecord',
              component: () => import('@/views/record/index.vue'),
              props: { lotteryCode: 'JNDSSC' },
            },
          ],
        },
      ],
    },
    {
      path: '/:pathMatch(.*)*',
      name: '404',
      component: () => import('@/views/404.vue'),
    },
  ],
})

export default router
